package com.cms.amp.ui

import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.android.baselibrary.arouter.ArouterContains
import com.android.baselibrary.base.BaseActivity
import com.android.baselibrary.base.BaseAdapter
import com.android.baselibrary.base.BasePath
import com.android.baselibrary.recycler.grid
import com.cms.amp.R
import com.cms.amp.databinding.ActivityAmpBinding
import com.cms.amp.databinding.ItemAmpBinding
import com.cms.data.AMPData

@Route(path = ArouterContains.MODEL_AMP)
class AMPMainActivity:BaseActivity<ActivityAmpBinding>() {
    override fun getLayoutId(): Int = R.layout.activity_amp

    override fun initView() {
      mBinding.recycle.grid(2).adapter = object :BaseAdapter<BasePath,ItemAmpBinding>(){
          override fun getItemLayoutId(): Int  = R.layout.item_amp

          override fun covert(binding: ItemAmpBinding, t: BasePath, position: Int) {
              binding.bean = t
              binding.tv.setOnClickListener {
                  ARouter.getInstance().build(t.path).navigation()
              }
          }

      }.setData(AMPData.list)
    }

    override fun initListener() {

    }
}